Skip to content

Rollup of 8 pull requests - #157146

Closed
JonathanBrouwer wants to merge 22 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-He4xKpW
Closed

Rollup of 8 pull requests#157146
JonathanBrouwer wants to merge 22 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-He4xKpW

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

ajasad25 and others added 22 commits May 22, 2026 15:32
And reduce visibility of functions only used within the crate.
cg_clif needs this as it passes inline assembly to an external assembler,
producing a separate object file. Currently it emits multiple
CompiledModules, but this is not compatible with using the codegen
coordinator of cg_ssa.
…guous_assoc_item`

Moreover, in `probe_single_bound_for_assoc_item` unconditionally return
an `Err(_)` if there's more than a single bound (aka ambiguity) instead
of returning the first bound in some cases. This avoids triggering a
debug assertion later on ("not enough bound vars"). See the added test
for details.
…rcote

HIR ty lowering: Move some things into submodules

By commit:

1. Move `compute_object_lifetime_bound` into submodule `dyn_trait` since it's only used there unsurprisingly
2. Move a `impl Diagnostic for AmbiguousAssocItem` into submodule `errors` and rename the diagnostic struct
   * For what it represents, it was way too prominent right at the start of `lower_type_relative_path` which didn't use to be the case prior to PR rust-lang#153452
3. Move a distractingly lengthy "error builder" into a new fn `report_ambiguous_assoc_item` in submodule `errors`
   * Since we unconditionally `return Err(_)` after calling this new function, we fix a debug assertion (see commit message & description of added UI test for details)

Fixes rust-lang#139387
Allow two object files for a single CGU in CompiledModule

cg_clif needs this as it passes inline assembly to an external assembler, producing a separate object file. Currently it emits multiple CompiledModules, but this is not compatible with using the codegen coordinator of cg_ssa.
…s, r=JohnTitor

Use `trait_object_dummy_self` more & heavily fix+update related docs

1. Use `trait_object_dummy_self` (`Infer(FreshTy(0))`) in more places
   * Two places used to construct this dummy self type manually (`Ty::new_fresh(tcx, 0)`)
   * One used to use `usize` as a dummy self type!
2. Really flesh out the docs of `trait_object_dummy_self`
3. Rewrite severely outdated & wrong (doc) comments from scratch (some date back to 2018)
4. ~~Uncomment~~ Add a FIXME to a debug assertion that was accidentally commented out in a *refactoring* PR **back in 2018**!
…ostic, r=cjgillot

Fix tupled closure signature in `AsyncFn` arg mismatch diagnostic

Closes rust-lang#155636
…arens-152761, r=joshtriplett

style: Clarify nullary call and `()` no-break rule applies past max width

…idth
…ity, r=cjgillot

Remove unused functions in `value_analysis.rs`

And also reduce some visibilities. Details in individual commits.

r? @cjgillot
…suggestion-fix, r=nnethercote

Fixed more &x ->&mut x suggestions

This PR fixes additional issues related to rust-lang#148467, i.e. compiler still suggests incorrect fixes for adding mut to deref patterns (needing additional parens) in other bindings besides for loop

```rust
fn let_deref(num_ref: &u32) -> u32 {
    let &num = num_ref;

    num *= 2; //~ ERROR cannot assign twice to immutable variable `num`

    num
}

fn deref_inside_pattern(option_num_ref: Option<&u32>) {
    if let Some(&num) = option_num_ref {
        num *= 2; //~ ERROR cannot assign twice to immutable variable `num`

        println!("{num}");
    }
}
```

```
...
help: consider making this binding mutable
  |
2 |     let &mut num = num_ref;
  |          +++
...
help: consider making this binding mutable
   |
10 |     if let Some(&mut num) = option_num_ref {
   |                  +++
```
…hile-let-note, r=Nadrieril

Note irrefutable while let in loop type errors

When a while-let loop is used where a non-unit value is expected, rustc already notes that while loops evaluate to unit. For simple irrefutable while-let patterns, add an extra note explaining that the pattern always matches and the loop condition never fails. Covers binding, wildcard, and tuples made from those patterns.

Fixes rust-lang#116572.

Tested with: ```./x test tests/ui/coercion/coerce-loop-issue-122561.rs --bless```
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 30, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-style Relevant to the style team, which will review and decide on the PR/issue. labels May 30, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c9583e0 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 30, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 30, 2026
@rust-bors

rust-bors Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@JonathanBrouwer
JonathanBrouwer deleted the rollup-He4xKpW branch August 21, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-style Relevant to the style team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants